Skip to content

Conversation

philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Oct 6, 2025

📜 Description

Added support for OTel/W3C trace propagation by introducing a new option enablePropagateTraceparent that controls whether the SDK adds the W3C traceparent HTTP header to outgoing requests.

Docs PR getsentry/sentry-docs#15159

💡 Motivation and Context

Fixes GH-6017

💚 How did you test it?

Added unit tests to verify the traceparent header is correctly added when the feature is enabled and not added when disabled. Also tested that existing headers aren't overridden.

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Copy link
Member Author

philipphofmann commented Oct 6, 2025

Copy link
Contributor

github-actions bot commented Oct 6, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 1b58355

@philipphofmann philipphofmann marked this pull request as ready for review October 6, 2025 09:06
cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann self-assigned this Oct 6, 2025
@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch 3 times, most recently from 957c698 to 7658828 Compare October 6, 2025 09:13
@philipphofmann philipphofmann marked this pull request as draft October 6, 2025 09:14
cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch 2 times, most recently from 08b8399 to e059998 Compare October 6, 2025 09:24
@philipphofmann philipphofmann marked this pull request as ready for review October 6, 2025 09:24
cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann marked this pull request as draft October 6, 2025 09:27
Copy link

codecov bot commented Oct 6, 2025

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
4019 3 4016 31
View the top 3 failed test(s) by shortest run time
iOS_Swift_UITests.LaunchUITests::testCaptureException
Stack Traces | 0s run time
.../iOS-Swift/iOS-Swift-UITests/LaunchUITests.swift:43 - Failed to Error Domain=com.apple.dt.XCTest.XCTFuture Code=1000 "Timed out while evaluating UI query." UserInfo={NSLocalizedDescription=Timed out while evaluating UI query.}: Timed out while evaluating UI query.
iOS_Swift_UITests.LaunchUITests::testCheckSlowAndFrozenFrames
Stack Traces | 0s run time
.../iOS-Swift/iOS-Swift-UITests/LaunchUITests.swift:66 - Failed to Error Domain=com.apple.dt.XCTest.XCTFuture Code=1000 "Timed out while evaluating UI query." UserInfo={NSLocalizedDescription=Timed out while evaluating UI query.}: Timed out while evaluating UI query.
iOS_Swift_UITests.LaunchUITests::testLoremIpsum
Stack Traces | 0s run time
.../iOS-Swift/iOS-Swift-UITests/LaunchUITests.swift:14 - Failed to Error Domain=com.apple.dt.XCTest.XCTFuture Code=1000 "Timed out while evaluating UI query." UserInfo={NSLocalizedDescription=Timed out while evaluating UI query.}: Timed out while evaluating UI query.

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copy link
Contributor

github-actions bot commented Oct 6, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1230.08 ms 1262.12 ms 32.03 ms
Size 23.75 KiB 1005.85 KiB 982.10 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
570f725 1206.00 ms 1238.96 ms 32.96 ms
ab0ba7e 1216.08 ms 1242.40 ms 26.31 ms
a6f5396 1211.81 ms 1245.63 ms 33.82 ms
6502818 1229.08 ms 1245.46 ms 16.37 ms
04ff3ec 1220.71 ms 1253.86 ms 33.15 ms
c122943 1210.94 ms 1233.78 ms 22.84 ms
59fc426 1240.49 ms 1256.94 ms 16.45 ms
397b9c9 1230.23 ms 1249.29 ms 19.06 ms
51b7dd3 1235.06 ms 1258.21 ms 23.15 ms
2a6f451 1212.89 ms 1237.45 ms 24.56 ms

App size

Revision Plain With Sentry Diff
570f725 23.74 KiB 913.38 KiB 889.63 KiB
ab0ba7e 23.75 KiB 904.54 KiB 880.79 KiB
a6f5396 23.75 KiB 989.12 KiB 965.38 KiB
6502818 23.75 KiB 959.45 KiB 935.70 KiB
04ff3ec 23.75 KiB 880.26 KiB 856.52 KiB
c122943 23.74 KiB 926.65 KiB 902.90 KiB
59fc426 23.75 KiB 920.64 KiB 896.89 KiB
397b9c9 23.75 KiB 959.44 KiB 935.70 KiB
51b7dd3 23.75 KiB 913.26 KiB 889.52 KiB
2a6f451 23.75 KiB 913.13 KiB 889.38 KiB

Previous results on branch: feat_add_propagating_of_traceparent

Startup times

Revision Plain With Sentry Diff
fec69f5 1233.02 ms 1266.88 ms 33.85 ms
1c5ce84 1219.49 ms 1249.06 ms 29.57 ms
ed645d9 1219.76 ms 1255.91 ms 36.16 ms
786f095 1231.33 ms 1261.23 ms 29.90 ms
fe4d5d5 1237.80 ms 1253.33 ms 15.53 ms
dea0f9c 1227.83 ms 1262.15 ms 34.32 ms

App size

Revision Plain With Sentry Diff
fec69f5 23.75 KiB 987.44 KiB 963.69 KiB
1c5ce84 23.75 KiB 987.45 KiB 963.70 KiB
ed645d9 23.75 KiB 995.62 KiB 971.87 KiB
786f095 23.75 KiB 988.54 KiB 964.80 KiB
fe4d5d5 23.75 KiB 990.49 KiB 966.74 KiB
dea0f9c 23.75 KiB 990.65 KiB 966.90 KiB

@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch 2 times, most recently from 81880fc to 532f4d6 Compare October 6, 2025 11:20
@philipphofmann philipphofmann marked this pull request as ready for review October 6, 2025 11:20
@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch 2 times, most recently from 88a830e to 532f4d6 Compare October 8, 2025 02:44
cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann force-pushed the ref_remove_sentrysdk_from_trace_propagation_class branch from 3f3c1fe to 750199d Compare October 8, 2025 02:50
@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch from 532f4d6 to 8203702 Compare October 8, 2025 02:50
cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch from 8203702 to 932a47c Compare October 8, 2025 02:55
@noahsmartin
Copy link
Contributor

It looks like you might have ran the api file generation using Xcode 26, CI uses 16.4 so it won't pass CI unless you use that. This was because Xcode 26 doesn't include the objc public API (only Swift)

@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch from 932a47c to 17322cb Compare October 8, 2025 05:10
@philipphofmann philipphofmann force-pushed the ref_remove_sentrysdk_from_trace_propagation_class branch from 750199d to 8f2d7b7 Compare October 8, 2025 05:10
cursor[bot]

This comment was marked as outdated.

@philipphofmann philipphofmann force-pushed the ref_remove_sentrysdk_from_trace_propagation_class branch 2 times, most recently from a48560a to a3dc1e0 Compare October 8, 2025 05:48
Base automatically changed from ref_remove_sentrysdk_from_trace_propagation_class to main October 10, 2025 03:57
@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch from 17322cb to ae307fd Compare October 10, 2025 04:02
Add the option propagateTraceparent, which is disabled by default. When
enabled, it adds the W3C Trace Context HTTP header traceparent on
outgoing HTTP requests. This is useful when the receiving services only
support OTel/W3C propagation.

Fixes GH-6017
@philipphofmann philipphofmann force-pushed the feat_add_propagating_of_traceparent branch from ae307fd to 3e7817b Compare October 10, 2025 04:07
Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code can easily blow up and is hard to test. We had severe bugs in the past. Be extra careful when changing these files, and have an extra careful look at these:

  • Sources/Sentry/SentryNetworkTracker.m

@philipphofmann philipphofmann merged commit 8800ba1 into main Oct 16, 2025
204 of 210 checks passed
@philipphofmann philipphofmann deleted the feat_add_propagating_of_traceparent branch October 16, 2025 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add traceparent support to sentry-cocoa

2 participants